
// 处理问题

// https://segmentfault.com/a/1190000008626070
// https://segmentfault.com/a/1190000008626070
// https://www.jb51.net/article/158872.htm
// https://www.jb51.net/article/158872.htm
// 需要传递给另外一个drop的东西, 看需要定义
// 可以使用各种回调emit出去, 但是这种有点凌乱,命名需要注意
import { Directive, ElementRef, HostListener, Input, Renderer2 } from '@angular/core';

@Directive({
  selector: '[appDragandrdop]',
  
})
export class DragandrdopDirective {

  @Input('draggable')
  isdraggable:string;
  

  // 如何传递drag drop的东西
  @Input('data')
  data:string;


  constructor(private _elementRef:ElementRef, private renderer:Renderer2) {
    console.log('获取挂载属性dom');
    console.log('something in the world.');
    this.setStyle()
  }


  @HostListener('click', ['$event'])
  onclick(evt) {
    alert()
    console.log(evt);
  }
  
  private setStyle() {
    this.renderer.setStyle(this._elementRef.nativeElement, 'color','red');
  }
  

}
